<?php

class All extends TPage
{
	public $user_manager;
	public $count;
	
	public function onLoad($params)
	{
		parent::onLoad($params);
		
		$this->user_manager = $this->Application->Modules['users'];
		$page = $this->Application->Request['site'];
		$this->count = $this->user_manager->countUsers();
		
		$this->site_manager->setData(	$this->Page->getPagePath(),
										array(),
										$this->count,
										10);
			
		$this->UserList->DataSource = $this->user_manager->getUsersList(
													true,
													$this->site_manager->getOffset(),
													$this->site_manager->getElementsPerSite());
		$this->UserList->dataBind();
	}
	
	public function deleteButtonClicked($sender, $param)
	{
		$this->user_manager->deleteUser($param->CommandParameter);
		$this->Application->Response->reload();
	}
	
	public function editButtonClicked($sender, $param)
	{
		$this->Response->redirect(
			$this->Service->constructUrl(	'admin.users.Edit',
											array('id' => $param->CommandParameter)));
	}
}

?>